package com.omar.labs.tamtamy.XML;

import java.util.ArrayList;

import com.omar.labs.tamtamy.Content;
import com.omar.labs.tamtamy.ContentList;
import com.omar.labs.tamtamy.XML.XMLContentLink;
import com.omar.labs.tamtamy.utils.XMLUtility;

public class XMLContentList extends ContentList {

	public XMLContentList(String xml){
		super();
		ArrayList<String> v = XMLUtility.getNodesValue(xml, "it.reply.tt.rest.entity.KcLContent");
		for(int i=0; i<v.size(); i++){
			String tmp = v.get(i);
			Content tmpCont = new XMLContent(tmp);
			this.add(tmpCont);  
		}			
	}
	
	public static ArrayList<String> getContentListIDs(String xml, String tagName){		
		return XMLUtility.getNodesValue(xml, tagName);					  		
	}

	public void print(){
		for(int i=0; i<this.size(); i++){
			this.get(i).print();
		}
	}
}
